<%-- 
    Document   : requestList
    Created on : May 30, 2011, 3:13:27 PM
    Author     : Kevin
--%>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page contentType="text/html" import=" com.movie.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@include file="headerv.html"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Request List:</h1><br><br>
        <% Set requestList = (Set) request.getAttribute("requestList");
            Iterator i = requestList.iterator();
            while (i.hasNext()) {
                Friend f = (Friend)i.next();%>

        <table>
            <tr>
                <td>    
                    Request from:
                </td>
                <td> 
                    <%=f.getViewer().getFirstname() %>&nbsp;<%=f.getViewer().getLastname() %>
                </td>
             </tr>
             <tr>
                <td>    
                    Message:
                </td>
                <td> 
                    <%=f.getComment() %>&nbsp;
                </td>
             </tr>
             <tr>
                <td>    
                    
                </td>
                <td> 
                    <input type="button" value="Accept" onclick="javascript:location.href='dispatcher?operation=acceptrequest&friendid=<%=f.getViewer().getIdviewer() %>'">
                    <input type="button" value="Reject" onclick="javascript:location.href='dispatcher?operation=rejectrequest&friendid=<%=f.getViewer().getIdviewer() %>'">
                </td>
             </tr>


        </table>

        <%}%>
    </body>
</html>
<%@include file="footer.html"%>